#include "Thread.h"

using namespace Framework;

Thread::~Thread()
{

}

void* Thread::dispatchThread(void* _data)
{
    if(!_data)
    {
        return 0;
    }

    static_cast<Thread*>(_data)->runThread();
    pthread_exit(_data);

    return 0;
}

void Thread::startThread()
{
    pthread_create(&m_thread, 0, Thread::dispatchThread, this);
}

void Thread::joinThread()
{
    pthread_join(m_thread, 0);
}
